package net.sf.eclipseshell.clojureenvironment.clojureinterfacespec;

import java.util.Collection;


public class ClojureInterfaceTest extends ClojureBaseTestCase {

	protected void setUp() throws Exception {
		super.setUp();
	}
 
	public void testAutoCompleteInterface() throws Exception{
		
		// TODO: replace this with some loader func that loads the eclipse-shell clojure file
		evalCode("(ns eclipseshell-clojure)\n" +
				"(defn symbol-to-doc-vectors [] " +
				"  (sort-by (comp first) (map (fn [x]"+
				   "[(get (meta (second x)) :name )  (get (meta (second x)) :doc ) ] )"+   
					 "(ns-publics 'clojure.core  )))"+
					 ")\n");
		
//		Object ret = evalCode("(+ 1 1)");
//		Object ret = evalCode("(eclipseshell-clojure/symbol-to-doc-vectors)");
		Object ret = evalCode("(eclipseshell-clojure/symbol-to-doc-vectors)");
		assertNotNull(ret);
		assertTrue(ret instanceof Collection);
		if (ret instanceof Collection) {
			Collection symbols = (Collection) ret;
			assertTrue(symbols.size() > 0);
		}
	}
	
	
}
